<?php
namespace Home\Controller;
use Think\Controller;
class PlaninfoController extends Controller {
	public function aa(){
		echo 'hahahah';
	}
    public function index(){
		$data['user_id']        = $_SESSION['User_phone']; //用户ID
		$data['plan_time']      = date('Y-m-d H:i:s',I('Plan_time'));//计划时间
		$data['plan_peoplenum'] = I("Plan_peoplenum");//人数
		$data['msg_info']       = I('Msg_info');//内容
		$data['status']         = I('Status');//状态
		$data['start_time']     = I('Start_time');//开始时间
		$data['end_time']       = I('End_time');//结束时间
		$data['start']          = I('Start');//开始地点
		$data['end']            =explode(",", I('End'));//结束地点
		$data['endnum']         = count($data['end']);
		$data['host_num']       = I('Host_num');//甲方人数
		$data['trip_mode']      = I('Trip_mode');//出行方式
		$data['sex_req']        = I('Sex_req');//性别限制
		$this->assign($data);
		$this->display();
    }
	public function planlist(){
		$model = M('planinfo');
		$info = $model->where('User_id ='.$_SESSION['User_phone'])->order('Plan_id desc')->limit(5)->select();
		foreach ($info as $key=>$val){
			$info[$key]['plan_time'] = date('Y-m-d',$val['plan_time']);
		}
		$this->assign('list',$info);
		$this->display('planlist');
	}
	public function planlistinfo(){
		$data['User_id'] = $_SESSION['User_phone'];
		$data['Plan_id'] = I('plan_id');
		$model = M('planinfo');
		$info = $model->where($data)->find();
		$info['plan_time'] = date('Y-m-d H:i:s',$info['plan_time']);
		//var_dump($info);die;
		$this->assign($info);
		$this->display('index');
	}
}
?>